package com.yunshang.ys.api;

import com.yunshang.ys.ys.YSHttpResult;

import java.util.List;

import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Url;
import rx.Observable;

/**
 * Created by Administrator on 2017/6/25.
 */

public interface DownImageApi {

    @GET
    Observable<ResponseBody> downImage(@Url String url);



    @FormUrlEncoded
    @POST("ajax/register")
    Observable<YSHttpResult<String>> registe (
            @Field("userId") String userId,
            @Field("userName") String userName,
            @Field("userIcon") String userIcon,
            @Field("email") String email,
            @Field("phone") String phone,
            @Field("password") String password);

//    userId、userName、userIcon、email、phone、password


    //上传图片文件到服务器生成url
    @Multipart
    @POST("image/ajax_upload")
    Observable<YSHttpResult<String>> uploadImage(@Part() List<MultipartBody.Part> parts);

}
